<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>赛事数据</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
	<link rel="stylesheet" href="../css/font.css">
	<link rel="stylesheet" href="../css/iconfont.css">
	<link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="../css/xadmin.css">
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script src="../lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="../js/xadmin.js"></script>
	<script src="../js/area.js"></script>
	<script src="../js/base.js"></script>
	<script src="../js/vue.min.js"></script>
	<style>
		/*赛事数据第三个*/
		.tab {
			width: 100%;
			height: auto;
			overflow: hidden;
		}

		.tab ul li {
			float: left;
			color: #0099FF;
			font-size: 14px;
			width: 15%;
			text-align: center;
			line-height: 43px;
			cursor: pointer;
			margin: 10px 24px 10px 0;

		}

		.tab ul .visited {
			border: 1px solid #0099FF;
			border-radius: 4px;
			color: #fff;
			background: #0099FF
		}

		.tab ul .no_act {
			color: #0099FF;
			border: 1px solid #ccc;
		}

		.con {
			width: 100%;
			height: auto;
			overflow: hidden;
		}

		.left_con {
			width: 830px;
			height: 218px;
			float: left;
			border: 1px solid #ccc;
			margin-top: 30px;
			padding: 10px;
			margin-bottom: 20px;
		}

		.left_con .status {
			border-bottom: 1px solid #ccc;
			line-height: 60px;
			padding: 0 20px;
		}

		.left_con .logo {
			margin: 30px 0 10px;
			padding: 0 20px;
			position: relative;
			width: 93%;
			height: auto;
			overflow: hidden;
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
		}

		.left_con .logo .left_logo {
			width: 120px;
			height: 100px;
			border: 1px solid #ccc;
			overflow: hidden;
			float: left;
		}

		.left_con .logo .left_logo img {
			width: 100%;
			height: 100%;
			display: block;
			margin: 0 auto;
		}

		.left_con .logo .right_logo {
			width: 120px;
			height: 100px;
			border: 1px solid #ccc;
			overflow: hidden;
			float: right;
		}

		.left_con .logo .right_logo img {
			width: 100%;
			height: 100%;
			display: block;
			margin: 0 auto;
		}

		.left_con .logo p {
			text-align: center;
			font-size: 24px;
			font-weight: bolder;
			color: #333;
			line-height: 100px;
		}

		.edit_btn {
			border: 1px solid #333;
			border-radius: 4px;
			width: 120px;
			height: 40px;
			line-height: 40px;
			text-align: center;
			color: #333;
			cursor: pointer;
			float: right;
			margin: 114px 100px 114px 0;
		}

		.table {
			border: 1px solid #ccc;
			width: 98.5%;
			height: auto;
			overflow: hidden;
			padding: 0.5%;
			margin-bottom: 20px;
		}

		.table .tit {
			background: #999;
			color: #fff;
			line-height: 30px;
			padding: 0 10px;
		}

		.con dl .dt {
			display: block;
		}

		.con dl .dd {
			display: none;
		}

		table {
			border-collapse: collapse;
			font-size: 14px;
		}

		td {
			padding: 6px 8px;
			text-align: center;
			color: #333;
		}

		th {
			width: 120px;
			border-right: #fff 1px solid;
			padding: 6px 8px;
			color: #333;
			background: #ccc;
		}

		th:last-child {
			border-right: none;
		}

		.title .pull-left {
			float: left;
			font-size: 18px;
			font-weight: 700;
			color: #b1b1b1;
			line-height: 42px;
		}

		.title .pull-left.active {
			color: #333;
			border-bottom: 1px solid #42abff;
		}

		.title .pull-left.active .num {
			font-size: 33px;
			color: #3385c6;
		}

		.title .pull-left .num {
			font-size: 33px;
		}

		.layui-form-select dl {
			max-height: 200px;
		}

		.layui-icon {
			font-weight: 700;
			cursor: pointer;
			font-size: 21px;
		}

		[v-cloak] {
			display: none;
		}

		.onedit {
			padding-bottom: 200px
		}

		.layui-form-label {
			float: none;
			display: inline-block;
		}

		.layui-form-item .layui-input-inline {
			float: none;
		}

		.layui-form-item .layui-input-inline {
			width: 370px;
		}
	</style>
</head>

<body style="background: #fff;">
	<div class="layui-fluid" id="All_List">
		<div class="layui-row layui-col-space15" v-cloak>
			<div class="layui-col-md12">
				<div class="layui-card" style="display: flex;justify-content: space-between;">
					<div class="layui-card-body ">
						<div class="title">
							<div class="topstep1 pull-left" style="margin-right:30px">
								<span class="num">01</span>
								<span>赛程安排</span>
							</div>
							<div class="pull-left" style="margin-right:30px">
								<img src="../images/jiantou.jpg" alt="">
							</div>
							<div class="topstep2 pull-left" style="margin-right:30px">
								<span class="num">02</span>
								<span>裁判安排</span>
							</div>
							<div class="pull-left" style="margin-right:30px">
								<img src="../images/jiantou.jpg" alt="">
							</div>
							<div class="topstep2 pull-left  active focus">
								<span class="num">03</span>
								<span>赛事数据</span>
							</div>
							<div style="clear: both;"></div>
						</div>
					</div>
				</div>
				<div class="layui-card" style="display: flex;justify-content: space-between;">
					<div class="layui-card-body " style="width: 100%;">
						<div class="tab">
							<ul>
								<li :class="currentIndex == index ? 'visited' : 'no_act'" v-for='(item,index) in items'
									@click="show?'':change(index)">{{item.dayDate}}</li>
							</ul>
						</div>
						<div class="clear"></div>
						<div class="con">
							<dl>
								<dt class="dt">
									<div class="left_con">
										<div class="status">
											<span>{{oneItem.roundInfo}}</span>
										</div>
										<div class="logo">
											<div class="left_logo">
												<img :src="oneItem.primaryHeadPhoto" alt="">
											</div>
											<p>
												{{oneItem.primaryTeam}}&emsp;<span
													v-if="oneItem.primaryAllGoal&&oneItem.primaryAllGoal.goals">{{oneItem.primaryAllGoal.goals}}</span>
												-
												<span
													v-if="oneItem.assistantAllGoal&&oneItem.assistantAllGoal.goals">{{oneItem.assistantAllGoal.goals}}</span>&emsp;{{oneItem.assistantTeam}}
											</p>
											<div class="right_logo">
												<img :src="oneItem.assistantHeadPhoto" alt="">
											</div>
										</div>
									</div>
									<div class="edit_btn" @click="editAble" v-if="!primaryTeamScore90">编辑数据</div>
									<div class="clear"></div>
									<div class="table">
										<form :class="show?'layui-form onedit':'layui-form'">
											<div class="layui-form-item">
												<label class="layui-form-label" style="width: 130px;"><span
														class="x-red">*</span>90分钟内的比分：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="主队分数"
														v-model='primaryTeamScore90' :disabled="!show">
												</div>
												<span> ：</span>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="客队分数"
														v-model="assistantTeamScore90" :disabled="!show">
												</div>
												<label class="layui-form-label" style="width: 130px;"><span
														class="x-red">*</span>获胜方：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" v-model="winnerScore90"
														disabled="true" v-if="!show">
													<select name="winnerScore90" lay-filter="select1" v-show="show">
														<option value="">请选择</option>
														<option :value="winnerScoreKickId1">{{winnerScoreKickName1}}
														</option>
														<option :value="winnerScoreKickId2">{{winnerScoreKickName2}}
														</option>
													</select>
												</div>
											</div>
											<div class="layui-form-item">
												<label class="layui-form-label" style="width: 130px;">加时赛比分：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="主队加时赛分数"
														v-model="primaryTeamScoreOvertime" :disabled="!show">
												</div>
												<span> ：</span>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="客队加时赛分数"
														v-model="assistantTeamScoreOvertime" :disabled="!show">
												</div>
												<label class="layui-form-label" style="width: 130px;">获胜方：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" v-model="winnerOvertime"
														disabled="true" v-if="!show">
													<select name="winnerOvertime" lay-filter="select2" v-show="show">
														<option value="">请选择</option>
														<option :value="winnerScoreKickId1">{{winnerScoreKickName1}}
														</option>
														<option :value="winnerScoreKickId2">{{winnerScoreKickName2}}
														</option>
													</select>
												</div>
											</div>
											<div class="layui-form-item">
												<label class="layui-form-label" style="width: 130px;">点球决赛比分：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="主队点球决赛分数"
														v-model="primaryTeamScoreKick" :disabled="!show">
												</div>
												<span> ：</span>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" placeholder="客队点球决赛分数"
														v-model="assistantTeamScoreKick" :disabled="!show">
												</div>
												<label class="layui-form-label" style="width: 130px;">获胜方：</label>
												<div class="layui-input-inline">
													<input type="text" class="layui-input" v-model="winnerScoreKick"
														disabled="true" v-if="!show">
													<select name="winnerScoreKick" lay-filter="select3" v-show="show">
														<option value="">请选择</option>
														<option :value="winnerScoreKickId1">{{winnerScoreKickName1}}
														</option>
														<option :value="winnerScoreKickId2">{{winnerScoreKickName2}}
														</option>
													</select>
												</div>
											</div>
										</form>
									</div>

						</div>
						<div class="table">
							<div class="tit">{{oneItem.primaryTeam}}</div>
							<form :class="show?'layui-form onedit':'layui-form'">
								<table style="width: 100%;">
									<tr>
										<th>序号</th>
										<th>号码</th>
										<th>球员 </th>
										<th>位置</th>
										<th>出场</th>
										<!-- <th>传球</th>
													<th>拖断</th>
													<th>拦截</th>
													<th>犯规</th>
													<th>越位</th>
													<th>助攻</th>
													<th>射门</th>
													<th>扑救</th> -->
										<th>红黄牌</th>
										<th>进球</th>
									</tr>
									<tr v-for="(item,index) in oneItemList1">
										<td>
											<div class="layui-btn-group" v-if="show">
												<i class="layui-icon" style="color:#3DB6FE;"
													@click="myAddList(index,1)">&#xe654;</i>
												<span style="margin: 0 2px;"></span>
												<i class="layui-icon" style="color: #FF5722;"
													@click="myDelList(index,1)">&#xe640;</i>
											</div>
											<span v-if="!show">{{index+1}}</span>
										</td>
										<td><span v-if="!show">{{item.clothesNum}}</span>
											<input v-if="show" class="layui-input" type="text"
												v-model="item.clothesNum">
										</td>
										<td>
											<!-- 球队1球员 -->
											<div v-show="show" class="layui-input-inline">
												<select name="playerUserName" lay-filter="select":value="item.playerName">
													<option v-for="(item,index) in allPlayerInTeam1" :value="item.id">{{item.name}}</option>
												</select>
												<input v-show="false" class="hidden" type="text"
													v-model="item.playerName">
											</div>
											<span v-if="!show">{{item.playerUserName}}</span>
										</td>
										<td>
											<!-- 球队1位置 -->
											<div v-show="show" class="layui-input-inline">
												<select name="positionName" lay-filter="select" :value="item.position">
													<option v-for="(item,index) in positionName":value="item.positionId">{{item.position}}
													</option>
												</select>
												<input v-show="false" class="hidden" type="text"
													v-model="item.position">
											</div>
											<span v-if="!show">{{item.positionName}}</span>
										</td>
										<td>
											<!-- 球队1首发 -->
											<div v-show="show" class="layui-input-inline">
												<select name="positionName" lay-filter="select" :value="item.playWay">
													<option v-for="(item,index) in playWayName":value="item.positionId">{{item.position}}</option>
												</select>
												<input v-show="false" class="hidden" type="text" v-model="item.playWay">
											</div>
											<span v-if="!show">{{item.playWayName}}</span>
										</td>
										<!-- <td><input v-if="show" class="layui-input" type="text"
															v-model="item.passBall"><span
															v-if="!show">{{item.passBall}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.dragged"><span
															v-if="!show">{{item.dragged}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.intercept"><span
															v-if="!show">{{item.intercept}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.foul"><span v-if="!show">{{item.foul}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.offside"><span
															v-if="!show">{{item.offside}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.assist"><span
															v-if="!show">{{item.assist}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.shoot"><span
															v-if="!show">{{item.shoot}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.putOut"><span
															v-if="!show">{{item.putOut}}</span>
													</td> -->
										<td><input v-if="show" class="layui-input" type="text"
												v-model="item.cards"><span v-if="!show">{{item.cards}}</span>
										</td>
										<td><input v-if="show" class="layui-input" type="text" v-model="item.goal"><span
												v-if="!show">{{item.goal}}</span>
										</td>
									</tr>
								</table>
							</form>
						</div>
						<div class="table">
							<div class="tit">{{oneItem.assistantTeam}}</div>
							<form :class="show?'layui-form onedit':'layui-form'">
								<table style="width: 100%;">
									<tr>
										<th>序号</th>
										<th>号码</th>
										<th>球员 </th>
										<th>位置</th>
										<th>出场</th>
										<!-- <th>传球</th>
													<th>拖断</th>
													<th>拦截</th>
													<th>犯规</th>
													<th>越位</th>
													<th>助攻</th>
													<th>射门</th>
													<th>扑救</th> -->
										<th>红黄牌</th>
										<th>进球</th>
									</tr>
									<tr v-for="(item,index) in oneItemList2">
										<td>
											<div class="layui-btn-group" v-if="show">
												<i class="layui-icon" style="color:#3DB6FE;"
													@click="myAddList(index,2)">&#xe654;</i>
												<span style="margin: 0 2px;"></span>
												<i class="layui-icon" style="color: #FF5722;"
													@click="myDelList(index,2)">&#xe640;</i>
											</div>
											<span v-if="!show">{{index+1}}</span>
										</td>
										<td><span v-if="!show">{{item.clothesNum}}</span>
											<input v-if="show" class="layui-input" type="text"
												v-model="item.clothesNum">
										</td>
										<td>
											<div v-show="show" class="layui-input-inline">
												<select name="playerUserName" lay-filter="select":value="item.playerName">
													<option v-for="(item,index) in allPlayerInTeam2" :value="item.id">{{item.name}}</option>
												</select>
												<input v-show="false" class="hidden" type="text"
													v-model="item.playerName">
											</div>
											<span v-if="!show">{{item.playerUserName}}</span>
										</td>
										<td>
											<div v-show="show" class="layui-input-inline">
												<select name="positionName" lay-filter="select" :value="item.position">
													<option v-for="(item,index) in positionName":value="item.positionId">{{item.position}}
													</option>
												</select>
												<input v-show="false" class="hidden" type="text"
													v-model="item.position">
											</div>
											<span v-if="!show">{{item.positionName}}</span>
										</td>
										<td>
											<!-- 球队1首发 -->
											<div v-show="show" class="layui-input-inline">
												<select name="positionName" lay-filter="select" :value="item.playWay">
													<option v-for="(item,index) in playWayName":value="item.positionId">{{item.position}}
													</option>
												</select>
												<input v-show="false" class="hidden" type="text" v-model="item.playWay">
											</div>
											<span v-if="!show">{{item.playWayName}}</span>
										</td>
										<!-- <td><input v-if="show" class="layui-input" type="text"
															v-model="item.passBall"><span
															v-if="!show">{{item.passBall}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.dragged"><span
															v-if="!show">{{item.dragged}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.intercept"><span
															v-if="!show">{{item.intercept}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.foul"><span v-if="!show">{{item.foul}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.offside"><span
															v-if="!show">{{item.offside}}</span></td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.assist"><span
															v-if="!show">{{item.assist}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.shoot"><span
															v-if="!show">{{item.shoot}}</span>
													</td>
													<td><input v-if="show" class="layui-input" type="text"
															v-model="item.putOut"><span
															v-if="!show">{{item.putOut}}</span>
													</td> -->
										<td><input v-if="show" class="layui-input" type="text"
												v-model="item.cards"><span v-if="!show">{{item.cards}}</span>
										</td>
										<td><input v-if="show" class="layui-input" type="text" v-model="item.goal"><span
												v-if="!show">{{item.goal}}</span>
										</td>
									</tr>
								</table>
							</form>

						</div>
						</dt>
						</dl>
					</div>

				</div>
				<div v-if="show" style="text-align: center;">
					<button type="button" class="layui-btn" @click="mySubmit1">
						保存
					</button>
					<button type="button" class="layui-btn" @click="myReload">
						取消
					</button>
				</div>
			</div>
		</div>
	</div>
	</div>
	<script>
		var valId;

		function child(params) {
			valId = params;
			layui.use(['table', 'laydate'], function () {
				var table = layui.table;
				var form = layui.form;
				var laydate = layui.laydate;
				var currentIndex = 0;

				$(document).ready(function () {
					setTimeout(function () {
						$(".tab ul li").eq(0).click()
					}, 200)
					$("body").on('click', '.tab ul li', function () {
						var index = $(this).index();
						if (currentIndex != index) {
							currentIndex = index;
							$(this).removeClass("no_act").addClass("visited");
							$(this).siblings().removeClass("visited").addClass("no_act");
							var contents = $(".con").find("dl dt");
							$(contents[index]).show();
							$(contents[index]).siblings().hide();
						}
					})
				});
				var winnerScore90Id = "",
					winnerScoreKickId = "",
					winnerOvertimeId = ""

				form.on('select(select1)', function (data) {
					winnerScore90Id = data.value
					console.log(winnerScore90Id)
				});
				form.on('select(select2)', function (data) {
					winnerScoreKickId = data.value
					console.log(winnerScoreKickId)
				});
				form.on('select(select3)', function (data) {
					winnerOvertimeId = data.value
					console.log(winnerOvertimeId)
				});
				var app = new Vue({
					el: "#All_List",
					data: {
						primaryTeamScore90: "",
						assistantTeamScore90: "",
						primaryTeamScoreOvertime: "",
						assistantTeamScoreOvertime: "",
						primaryTeamScoreKick: "",
						assistantTeamScoreKick: "",
						winnerScore90: "", //90分钟内获胜方
						winnerOvertime: "", //加时赛获胜方  
						winnerScoreKick: "", //点球决胜对战获胜方

						winnerScoreKickName1: "",
						winnerScoreKickName2: "",
						winnerScoreKickId1: "",
						winnerScoreKickId2: "",







						items: [], //所有数据
						oneItem: [], //当前页数据
						oneItemList1: [], //球队1球员信息
						oneItemList2: [], //球队2球员信息
						show: false, //是否显示编辑
						currentIndex: currentIndex, //当前页
						positionName: [{ //所有位置
								positionId: "",
								position: "请选择"
							}, {
								positionId: "0",
								position: "门将"
							},
							{
								positionId: "1",
								position: "后卫"
							}, {
								positionId: "2",
								position: "中场"
							}, {
								positionId: "3",
								position: "前锋"
							},
						],
						playWayName: [{
								positionId: "1",
								position: "替补"
							},
							{
								positionId: "0",
								position: "首发"
							}

						],
						allPlayerInTeam1: [], //球队1所有球员
						allPlayerInTeam2: [], //球队2所有球员
					},
					methods: {
						index: function () {
							var that = this
							$.ajax({ //获取球队信息
								url: getRoundInfoList,
								type: 'get',
								data: {
									competitionId: valId
								},
								dataType: 'json',
								success: function (data) {
									console.log(data)
									if (data.code == 200) {
										that.items = data.roundByCid;

									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									console.log(data)
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});

						},
						change: function (index) { //根据不同按钮跳转不同内容
							var that = this
							that.oneItem = that.items[index];
							that.oneItemList1 = that.oneItem.dataByPrimary;
							that.oneItemList2 = that.oneItem.dataByAssistant;
							that.getPlayerById()
							that.show = false
							that.primaryTeamScore90 = that.oneItem.primaryAllGoal.primaryTeamScore90;
							that.assistantTeamScore90 = that.oneItem.primaryAllGoal.assistantTeamScore90;
							that.primaryTeamScoreOvertime = that.oneItem.primaryAllGoal
								.primaryTeamScoreOvertime;
							that.assistantTeamScoreOvertime = that.oneItem.primaryAllGoal
								.assistantTeamScoreOvertime;
							that.primaryTeamScoreKick = that.oneItem.primaryAllGoal.primaryTeamScoreKick;
							that.assistantTeamScoreKick = that.oneItem.primaryAllGoal
								.assistantTeamScoreKick;
							that.winnerScore90 = that.oneItem.primaryAllGoal.winnerScore90; //90分钟内获胜方
							that.winnerOvertime = that.oneItem.primaryAllGoal.winnerOvertime; //加时赛获胜方  
							that.winnerScoreKick = that.oneItem.primaryAllGoal
								.winnerScoreKick; //点球决胜对战获胜方

							that.winnerScoreKickName1 = that.oneItem.primaryTeam;
							that.winnerScoreKickName2 = that.oneItem.assistantTeam;
							that.winnerScoreKickId1 = that.oneItem.primaryTeamId;
							that.winnerScoreKickId2 = that.oneItem.assistantTeamId;

							that.assistantTeamScoreKickName1 = that.oneItem.primaryTeam;
							that.assistantTeamScoreKickName2 = that.oneItem.assistantTeam;
							that.assistantTeamScoreKickId1 = that.oneItem.primaryTeamId;
							that.assistantTeamScoreKickId2 = that.oneItem.assistantTeamId;

						},
						editAble: function () { //显示编辑
							$("body").unbind()
							$(".tab ul li").css("cursor", "not-allowed")
							var that = this
							var newlist = {
								"passBall": "",
								"cards": "",
								"remark": "",
								"playWay": "",
								"foul": "",
								"positionName": "",
								"number": "",
								"shoot": "",
								"id": "",
								"roundId": "",
								"playerId": "",
								"competitionId": "",
								"goal": "",
								"playerName": "",
								"minutes": "",
								"playerUserName": "",
								"clothesNum": "",
								"dragged": "",
								"offside": "",
								"intercept": "",
								"teamId": "",
								"assist": "",
								"putOut": "",
								"position": "",
								"playWayName": ""
							}
							var newlist2 = {
								"passBall": "",
								"cards": "",
								"remark": "",
								"playWay": "",
								"foul": "",
								"positionName": "",
								"number": "",
								"shoot": "",
								"id": "",
								"roundId": "",
								"playerId": "",
								"competitionId": "",
								"goal": "",
								"playerName": "",
								"minutes": "",
								"playerUserName": "",
								"clothesNum": "",
								"dragged": "",
								"offside": "",
								"intercept": "",
								"teamId": "",
								"assist": "",
								"putOut": "",
								"position": "",
								"playWayName": ""
							}
							that.show = true;
							if (that.oneItemList1.length == 0) {
								that.oneItemList1.push(newlist)
								setTimeout(function () {
									form.render()
								}, 50);
							}
							if (that.oneItemList2.length == 0) {
								that.oneItemList2.push(newlist2)
								setTimeout(function () {
									form.render()
								}, 50);
							}
							setTimeout(function () { 
								form.render();
							 },50)
							form.on('select(select)', function (data) {
								$(this).parent().parent().next().val(data.value);
								for (var i = 0; i < $("input").length; i++) {
									$("input")[i].dispatchEvent(new Event('input'))
								}
							});

						},
						myAddList: function (index, num) {
							var that = this
							var newlist = {
								"passBall": "",
								"cards": "",
								"remark": "",
								"playWay": "",
								"foul": "",
								"positionName": "",
								"number": "",
								"shoot": "",
								"id": "",
								"roundId": "",
								"playerId": "",
								"competitionId": "",
								"goal": "",
								"playerName": "",
								"minutes": "",
								"playerUserName": "",
								"clothesNum": "",
								"dragged": "",
								"offside": "",
								"intercept": "",
								"teamId": "",
								"assist": "",
								"putOut": "",
								"position": "",
								"playWayName": ""
							}
							if (num == 1) {
								that.oneItemList1.splice(index + 1, 0, newlist);
								setTimeout(function () {
									form.render()
								}, 50);
							} else {
								that.oneItemList2.splice(index + 1, 0, newlist);
								setTimeout(function () {
									form.render()
								}, 50);
							}
						},
						myDelList: function (index, num) {
							var that = this;
							var newlist = {
								"passBall": "",
								"cards": "",
								"remark": "",
								"playWay": "",
								"foul": "",
								"positionName": "",
								"number": "",
								"shoot": "",
								"id": "",
								"roundId": "",
								"playerId": "",
								"competitionId": "",
								"goal": "",
								"playerName": "",
								"minutes": "",
								"playerUserName": "",
								"clothesNum": "",
								"dragged": "",
								"offside": "",
								"intercept": "",
								"teamId": "",
								"assist": "",
								"putOut": "",
								"position": "",
								"playWayName": ""
							}
							if (num == 1) {
								that.oneItemList1.splice(index, 1);
								if (that.oneItemList1.length == 0) {
									that.oneItemList1.push(newlist)
									setTimeout(function () {
										form.render()
									}, 50);
								}
								setTimeout(function () {
									form.render()
								}, 50);
							} else {
								that.oneItemList2.splice(index, 1);
								if (that.oneItemList2.length == 0) {
									that.oneItemList2.push(newlist)
									setTimeout(function () {
										form.render()
									}, 50);
								}
								setTimeout(function () {
									form.render()
								}, 50);
							}
						},
						myReload: function () {
							location.reload()
						},
						mySubmit1: function () { //提交队伍1球员信息
							var that = this
							var primaryTeamScore90 = that.primaryTeamScore90;
							var assistantTeamScore90 = that.assistantTeamScore90;
							if (primaryTeamScore90 == "" || assistantTeamScore90 == "" ||
								winnerScore90Id == "") {
								layer.msg("请填写必填项")
								return false
							}

							var competitionId = that.items[currentIndex].competitionId;
							var roundId = that.items[currentIndex].id;
							var teamId = that.items[currentIndex].primaryTeamId;
							var playerCompetitionData = JSON.stringify(that.oneItemList1)
							$.ajax({ //获取球队1球员列表
								url: addOrUpdateCompetitionData,
								type: 'get',
								data: {
									competitionId: competitionId,
									roundId: roundId,
									teamId: teamId,
									playerCompetitionData: playerCompetitionData,
								},
								dataType: 'json',
								success: function (data) {
									if (data.code == 200) {
										that.mySubmit2()
									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});

						},
						mySubmit2: function () { //提交队伍2球员信息
							var that = this;
							var competitionId = that.items[currentIndex].competitionId;
							var roundId = that.items[currentIndex].id;
							var teamId = that.items[currentIndex].assistantTeamId;
							var playerCompetitionData = JSON.stringify(that.oneItemList2)
							$.ajax({ //获取球队1球员列表
								url: addOrUpdateCompetitionData,
								type: 'get',
								data: {
									competitionId: competitionId,
									roundId: roundId,
									teamId: teamId,
									playerCompetitionData: playerCompetitionData,
								},
								dataType: 'json',
								success: function (data) {
									if (data.code == 200) {
										that.mySubmit3()

									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});

						},
						mySubmit3: function () { //完善获胜方
							var that = this;
							var roundId = that.items[currentIndex].id;
							$.ajax({ //获取球队1球员列表
								url: updateRoundCompetitionData,
								type: 'get',
								data: {
									roundId: roundId,
									primaryTeamScore90: that.primaryTeamScore90,
									assistantTeamScore90: that.assistantTeamScore90,
									primaryTeamScoreOvertime: that.primaryTeamScoreOvertime,
									assistantTeamScoreOvertime: that.assistantTeamScoreOvertime,
									primaryTeamScoreKick: that.primaryTeamScoreKick,
									assistantTeamScoreKick: that.assistantTeamScoreKick,
									winnerScore90: winnerScore90Id, //90分钟内获胜方
									winnerOvertime: winnerOvertimeId, //加时赛获胜方  
									winnerScoreKick: winnerScoreKickId, //点球决胜对战获胜方

								},
								dataType: 'json',
								success: function (data) {
									if (data.msg == "0") {
										layer.alert("保存成功", {
											title: '提示',
											cancel: function (index, layero) {
												location.reload()
											}
										}, function (index) {
											layer.close(index)
											location.reload()
										})
									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});

						},
						getPlayerById: function () {
							var that = this
							$.ajax({ //获取球队1球员列表
								url: getPlayerByTeamId,
								type: 'get',
								data: {
									teamId: that.oneItem.primaryTeamId
								},
								dataType: 'json',
								success: function (data) {
									if (data.msg == 0) {
										that.allPlayerInTeam1 = data.playerList
									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});
							$.ajax({ //获取球队1球员列表
								url: getPlayerByTeamId,
								type: 'get',
								data: {
									teamId: that.oneItem.assistantTeamId
								},
								dataType: 'json',
								success: function (data) {
									if (data.msg == 0) {
										that.allPlayerInTeam2 = data.playerList
									} else {
										layer.alert(data.msg, {
											title: '提示'
										})
									}
								},
								error: function (data) {
									layer.alert(data.msg, {
										title: '提示'
									})
								}
							});

						}
					},
					created: function () {
						this.index()
					}
				})
			})
		}
	</script>
</body>

</html>